﻿@model HR.ProjectX.GUI.ViewModels.Vehicle.VehicleCreateView

@{
    ViewBag.Title = "Create";
}

@if (Model.HasIssue)
{
    <div style="color: #D63301; background-color: #FFCCBA; padding: 2px 2px 2px 10px; margin-bottom: 10px;" >
        <p>@Html.Encode(Model.Message)</p>
    </div>
}

<h1 class="page-title">Create New Car</h1>

@using (Html.BeginForm())
{
    <table>
        <tr>
            <td class="tbl-cell-label">
                <label>Category</label>
            </td>
        </tr>
        <tr>
            <td>
                <select name="SelectedCategory">
                    @foreach (var category in Model.VehicleCategories)
                    {
                        <option value="@category.VehicleDescription">@category.VehicleDescription</option>
                    }
                </select>
                @Html.ValidationMessageFor(model => model.SelectedCategory)
            </td>
        </tr>
        <tr>
            <td class="tbl-cell-label">
                <label>Manufacturer</label>
            </td>
        </tr>
        <tr>
            <td>
                <select name="SelectedManufacturer">
                    @foreach (var manufacturer in Model.Manufacturers)
                    {
                        <option value="@manufacturer.ManufacturerName">@manufacturer.ManufacturerName</option>
                    }
                </select>
                @Html.ValidationMessageFor(model => model.SelectedManufacturer)
            </td>
        </tr>
        <tr>
            <td class="tbl-cell-label">
                <label>Model</label>
            </td>
        </tr>
        <tr>
            <td>
                @Html.EditorFor(m => m.Model)
                @Html.ValidationMessageFor(model => model.Model)
            </td>
        </tr>
        <tr>
            <td class="tbl-cell-label">
                <label>Registration Number</label>
            </td>
        </tr>
        <tr>
            <td>
                @Html.EditorFor(r => r.RegistrationNumber)
                @Html.ValidationMessageFor(model => model.RegistrationNumber)
            </td>
        </tr>
        <tr>
            <td class="tbl-cell-label">
                <label>Current Kilometers</label>
            </td>
        </tr>
        <tr>
            <td>
                @Html.EditorFor(c => c.CurrentKilometers)
                @Html.ValidationMessageFor(model => model.CurrentKilometers)
            </td>
        </tr>
        <tr>
            <td class="tbl-cell-label">
                <label>Daily Hire Rate</label>
            </td>
        </tr>
        <tr>
            <td>
                @Html.EditorFor(d => d.DailyHireRate)
                @Html.ValidationMessageFor(model => model.DailyHireRate)
            </td>
        </tr>
        <tr>
            <td>
                <input type="submit" value="Create" />
            </td>
        </tr>
    </table>
}